package com.sinan.core.connector.components;

import com.sinan.core.connector.ValidationResult;

public interface Validator {


    Validator VALID = (subject, input) -> ValidationResult.builder()
            .subject(subject)
            .input(input)
            .valid(true)
            .build();

    /**
     * 校验输入
     * @param subject 被校验的对象
     * @param input   被校验的值
     * @return 校验结果
     */
    ValidationResult validate(String subject, String input);
}
